#-*- coding:utf-8 –*-

import pandas as pd
from pandas import Series,DataFrame

print "读取Csv".decode('utf-8').encode('cp936')

data = pd.read_csv("D:\Python27\project\pandas/excel.csv",encoding = "gb2312")
print data
#for row in data["name"]:
#	print row

#筛选 使用& (并) 与| (或) 实现多条件筛选
item1 = data[ (data["age"] > 30) & (data["age"] < 50) ]
print "30 < age < 50 = " + item1["name"]

#筛选 只需要其中两列数据，而同时利用另外两列进行筛选
item2 = data[["id", "name"]] [ (data.age < 30) | (data.age > 30) ]
print item2

#用isin方法筛选一些特定值
print "用isin方法筛选一些特定值".decode('utf-8').encode('cp936')
alist = [33]
item3 = data["age"].isin(alist)
print item3
